const express = require('express');
const bodyParser = require('body-parser');
const movieRoutes = require('./routes/movie.routes.js');
const screeningRoutes = require('./routes/screening.routes.js');
const flashSaleRoutes = require('./routes/flashSale.routes.js');
const userRoutes = require('./routes/user.routes.js');
const orderRoutes = require('./routes/order.routes.js');

const app = express();
app.use(bodyParser.json());

app.use('/api/movies', movieRoutes);
app.use('/api/screenings', screeningRoutes);
app.use('/api/flash-sales', flashSaleRoutes);
app.use('/api/users', userRoutes);
app.use('/api/orders', orderRoutes);

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
    console.log(`Server is running on port ${PORT}`);
});